#include "hplcqinfinedetectorsendpacket.h"
#include "hplcqinfinedetectorprotocoldata.h"
#include "common/hplcqinfinepfcid.h"
#include "common/hplcqinfinemakepacket.h"

namespace hplc
{
namespace qinfine
{

DetectorSendPacket::DetectorSendPacket(HplcQinfineDetectorProtocolData &data, QObject *parent)
    : HplcQinfineSendCommonPacket (data, parent)
{

}

DetectorSendPacket::~DetectorSendPacket()
{

}

void DetectorSendPacket::setWave(quint16 wave)
{
    HplcQinfineDetectorProtocolData *m_d = static_cast<HplcQinfineDetectorProtocolData*>(this->m_d);
    m_d->m_maker->makePacket(SET_PFC(PFC_DETECTOR_WAVE), wave);
    m_d->m_checker->sendRetry();
}

void DetectorSendPacket::getWave()
{
    HplcQinfineDetectorProtocolData *m_d = static_cast<HplcQinfineDetectorProtocolData*>(this->m_d);
    m_d->m_maker->makePacket(GET_PFC(PFC_DETECTOR_WAVE));
    m_d->m_checker->sendRetry();
}

void DetectorSendPacket::setWave2(quint16 wave)
{
    HplcQinfineDetectorProtocolData *m_d = static_cast<HplcQinfineDetectorProtocolData*>(this->m_d);
    m_d->m_maker->makePacket(SET_PFC(PFC_DETECTOR_WAVE2), wave);
    m_d->m_checker->sendRetry();
}

void DetectorSendPacket::getWave2()
{
    HplcQinfineDetectorProtocolData *m_d = static_cast<HplcQinfineDetectorProtocolData*>(this->m_d);
    m_d->m_maker->makePacket(GET_PFC(PFC_DETECTOR_WAVE2));
    m_d->m_checker->sendRetry();
}

void DetectorSendPacket::setTimeConst(quint8 timeConstIndex)
{
    HplcQinfineDetectorProtocolData *m_d = static_cast<HplcQinfineDetectorProtocolData*>(this->m_d);
    m_d->m_maker->makePacket(SET_PFC(PFC_DETECTOR_TIME_CONST), timeConstIndex);
    m_d->m_checker->sendRetry();
}

void DetectorSendPacket::getTimeConst()
{
    HplcQinfineDetectorProtocolData *m_d = static_cast<HplcQinfineDetectorProtocolData*>(this->m_d);
    m_d->m_maker->makePacket(GET_PFC(PFC_DETECTOR_TIME_CONST));
    m_d->m_checker->sendRetry();
}

void DetectorSendPacket::setRange(quint8 range)
{
    HplcQinfineDetectorProtocolData *m_d = static_cast<HplcQinfineDetectorProtocolData*>(this->m_d);
    m_d->m_maker->makePacket(SET_PFC(PFC_DETECTOR_RANGE), range);
    m_d->m_checker->sendRetry();
}

void DetectorSendPacket::getRange()
{
    HplcQinfineDetectorProtocolData *m_d = static_cast<HplcQinfineDetectorProtocolData*>(this->m_d);
    m_d->m_maker->makePacket(GET_PFC(PFC_DETECTOR_RANGE));
    m_d->m_checker->sendRetry();
}

void DetectorSendPacket::setLampType(quint8 flag)
{
    HplcQinfineDetectorProtocolData *m_d = static_cast<HplcQinfineDetectorProtocolData*>(this->m_d);
    m_d->m_maker->makePacket(SET_PFC(PFC_DETECTOR_LAMP_TYPE), flag);
    m_d->m_checker->sendRetry();
}

void DetectorSendPacket::getLampType()
{
    HplcQinfineDetectorProtocolData *m_d = static_cast<HplcQinfineDetectorProtocolData*>(this->m_d);
    m_d->m_maker->makePacket(GET_PFC(PFC_DETECTOR_LAMP_TYPE));
    m_d->m_checker->sendRetry();
}

void DetectorSendPacket::setChannel(quint8 channel)
{
    HplcQinfineDetectorProtocolData *m_d = static_cast<HplcQinfineDetectorProtocolData*>(this->m_d);
    m_d->m_maker->makePacket(SET_PFC(PFC_DETECTOR_CHANNEL), channel);
    m_d->m_checker->sendRetry();
}

void DetectorSendPacket::getChannel()
{
    HplcQinfineDetectorProtocolData *m_d = static_cast<HplcQinfineDetectorProtocolData*>(this->m_d);
    m_d->m_maker->makePacket(GET_PFC(PFC_DETECTOR_CHANNEL));
    m_d->m_checker->sendRetry();
}

void DetectorSendPacket::setLamp(quint8 flag)
{
    HplcQinfineDetectorProtocolData *m_d = static_cast<HplcQinfineDetectorProtocolData*>(this->m_d);
    m_d->m_maker->makePacket(SET_PFC(PFC_DETECTOR_LAMP), flag);
    m_d->m_checker->sendRetry();
}

void DetectorSendPacket::getLamp()
{
    HplcQinfineDetectorProtocolData *m_d = static_cast<HplcQinfineDetectorProtocolData*>(this->m_d);
    m_d->m_maker->makePacket(GET_PFC(PFC_DETECTOR_LAMP));
    m_d->m_checker->sendRetry();
}

void DetectorSendPacket::setZero(quint8 flag)
{
    HplcQinfineDetectorProtocolData *m_d = static_cast<HplcQinfineDetectorProtocolData*>(this->m_d);
    m_d->m_maker->makePacket(SET_PFC(PFC_DETECTOR_ZERO), flag);
    m_d->m_checker->sendRetry();
}

void DetectorSendPacket::setHome(quint8 flag)
{
    HplcQinfineDetectorProtocolData *m_d = static_cast<HplcQinfineDetectorProtocolData*>(this->m_d);
    m_d->m_maker->makePacket(SET_PFC(PFC_DETECTOR_HOME), flag);
    m_d->m_checker->sendRetry();
}

void DetectorSendPacket::getHome()
{
    HplcQinfineDetectorProtocolData *m_d = static_cast<HplcQinfineDetectorProtocolData*>(this->m_d);
    m_d->m_maker->makePacket(GET_PFC(PFC_DETECTOR_HOME));
    m_d->m_checker->sendRetry();
}

void DetectorSendPacket::setAuUploadFreq(quint8 factor)
{
    HplcQinfineDetectorProtocolData *m_d = static_cast<HplcQinfineDetectorProtocolData*>(this->m_d);
    m_d->m_maker->makePacket(SET_PFC(PFC_DETECTOR_AU_UPLOAD_FREQ), factor);
    m_d->m_checker->sendRetry();
}

void DetectorSendPacket::getAuUploadFreq()
{
    HplcQinfineDetectorProtocolData *m_d = static_cast<HplcQinfineDetectorProtocolData*>(this->m_d);
    m_d->m_maker->makePacket(GET_PFC(PFC_DETECTOR_AU_UPLOAD_FREQ));
    m_d->m_checker->sendRetry();
}

void DetectorSendPacket::getAu()
{
    HplcQinfineDetectorProtocolData *m_d = static_cast<HplcQinfineDetectorProtocolData*>(this->m_d);
    m_d->m_maker->makePacket(GET_PFC(PFC_DETECTOR_AU));
    m_d->m_checker->sendRetry();
}

void DetectorSendPacket::getWaveRefSam()
{
    HplcQinfineDetectorProtocolData *m_d = static_cast<HplcQinfineDetectorProtocolData*>(this->m_d);
    m_d->m_maker->makePacket(GET_PFC(PFC_DETECTOR_WAVE_REF_SAM));
    m_d->m_checker->sendRetry();
}

void DetectorSendPacket::getWave2RefSam()
{
    HplcQinfineDetectorProtocolData *m_d = static_cast<HplcQinfineDetectorProtocolData*>(this->m_d);
    m_d->m_maker->makePacket(GET_PFC(PFC_DETECTOR_WAVE2_REF_SAM));
    m_d->m_checker->sendRetry();
}

void DetectorSendPacket::setScanCMD(quint8 cmd)
{
    HplcQinfineDetectorProtocolData *m_d = static_cast<HplcQinfineDetectorProtocolData*>(this->m_d);
    m_d->m_maker->makePacket(SET_PFC(PFC_DETECTOR_SCAN_CMD), cmd);
    m_d->m_checker->sendRetry();
}

void DetectorSendPacket::getScanCMD()
{
    HplcQinfineDetectorProtocolData *m_d = static_cast<HplcQinfineDetectorProtocolData*>(this->m_d);
    m_d->m_maker->makePacket(GET_PFC(PFC_DETECTOR_SCAN_CMD));
    m_d->m_checker->sendRetry();
}

void DetectorSendPacket::setScanPara(quint16 waveStart, quint16 waveStop, quint8 speed)
{
    HplcQinfineDetectorProtocolData *m_d = static_cast<HplcQinfineDetectorProtocolData*>(this->m_d);
    m_d->m_maker->makePacket(SET_PFC(PFC_DETECTOR_SCAN_PARA), waveStart, waveStop, speed);
    m_d->m_checker->sendRetry();
}

void DetectorSendPacket::getScanPara()
{
    HplcQinfineDetectorProtocolData *m_d = static_cast<HplcQinfineDetectorProtocolData*>(this->m_d);
    m_d->m_maker->makePacket(GET_PFC(PFC_DETECTOR_SCAN_PARA));
    m_d->m_checker->sendRetry();
}

void DetectorSendPacket::getLampUsedTime()
{
    HplcQinfineDetectorProtocolData *m_d = static_cast<HplcQinfineDetectorProtocolData*>(this->m_d);
    m_d->m_maker->makePacket(GET_PFC(PFC_DETECTOR_LAMP_USED_TIME));
    m_d->m_checker->sendRetry();
}

void DetectorSendPacket::setStartStop(quint8 flag)
{
    HplcQinfineDetectorProtocolData *m_d = static_cast<HplcQinfineDetectorProtocolData*>(this->m_d);
    m_d->m_maker->makePacket(SET_PFC(PFC_DETECTOR_START_STOP), flag);
    m_d->m_checker->sendRetry();
}

void DetectorSendPacket::getStartStop()
{
    HplcQinfineDetectorProtocolData *m_d = static_cast<HplcQinfineDetectorProtocolData*>(this->m_d);
    m_d->m_maker->makePacket(GET_PFC(PFC_DETECTOR_START_STOP));
    m_d->m_checker->sendRetry();
}

} // qinfine
} // hplc
